1. Field of the Invention
The present invention relates to computer systems and, more particularly, to peripheral devices for computer systems.
2. Description of the Related Art
Peripheral devices are often used to supplement the resources of computer systems. One type of peripheral device is a removable storage media device (or portable storage media device) that provides data storage for a computer system. More particularly, computer systems often connect to one or more removable storage media drives to provide additional data storage for the computer systems. These storage media drives can, for example, be a floppy drive, a Compact-Disc (CD) drive, a hard drive, a removable card drive or a Digital Video Disc (DVD) drive. Such drives can be inserted into media bays of portable computer systems or can be separately housed peripheral devices.
Physically connecting a peripheral device to a computer system requires the electrical connection of the peripheral device to the computer system. The electrical connection is achieved with at least one connector. The connector supplies various signals, including address, data, power, and various other signals, between the peripheral device and the computer system. A first half of the connector resides on a cable of the peripheral device or on a housing of the peripheral device, and a second half of the connector resides on the housing of the computer system or on a cable of the computer system. An insertion action involves the connection of the first half of the connector on the cable or housing of the peripheral device with the second half of the connector on the cable or housing of the computer system. By coupling the two devices using at least one connector, the computer system is able to use the resources of the peripheral device. A removal action involves disconnection of: (i) the first half of the connector from the cable or housing of the peripheral device, (ii) the second half of the connector from the cable or housing of the computer system, or (iii) the first half of the connector from the second half of the connector.
Recently, techniques have been developed that allow the insertion and removal of peripheral devices from external slots or connectors of a computer system while the computer system is active. This is generally referred to as xe2x80x9chot pluggingxe2x80x9d or xe2x80x9chot unplugging.xe2x80x9d These techniques prevent electrical damage to the components but are often unable to configure the software structures needed by the operating system in order to utilize the peripheral device.
The removal of a peripheral device that provides data storage, namely, a storage media device, is particularly problematic because data can be lost or corrupted. Even if the storage media drive is not being accessed when the storage media drive is removed, the storage media drive is available for use by the computer system. In such cases, data can be lost or damaged by the removal of the storage media drive.
Hence, prior to removal of a storage media drive, it has been necessary to first inform the operating system of the computer system to prepare the storage media drive for removal. If, instead, a user were to remove the storage media drive without first getting approval from the operating system, then either data on the storage media drive was possibly lost or corrupted or the user was required to reinsert the storage media drive into the computer system so that the operating system can prepare it for removal. For example, once a storage media drive has been made available to a computer system, the storage media drive can be xe2x80x9clockedxe2x80x9d to encourage against incorrect removal of the storage media drive. In general, the xe2x80x9clockxe2x80x9d operates to halt processing and to inform the user that they have removed a xe2x80x9clockedxe2x80x9d storage media drive which should be reinserted to prevent possible data loss. Hence, if a xe2x80x9clockedxe2x80x9d storage media drive were to be removed without first being xe2x80x9cunlocked,xe2x80x9d the user would be encouraged with a visual warning to re-attach the storage media drive so that its removal can be safely managed.
Conventionally, insertion of a connector affiliated with a storage media drive would cause a host computer to mount the storage media drive with respect to the file system of the host computer. However, in order to remove the peripheral storage unit, an icon representing the storage media drive could be selected and dragged using the graphical user interface to a trashcan icon, thereby requesting disconnection. Alternatively, an eject command can request disconnection. In either case, the storage media drive would then be unmounted and disconnected.
When a peripheral device is coupled to a host computer and locked thereto, if the device is removed (i.e., disconnected) without requesting disconnection, a warning can be displayed to notify the user of their improper removal of the device and to request its reinsertion. Hence, conventional approaches merely notify the user that the device should not be removed or, if already removed, should be reconnected. Unfortunately, however, users expect devices to be able to be removed at any time they find it to be convenient. Accordingly, the conventional solutions to the removal of such devices are inadequate because they lead to consumer frustration and possibly loss of data. Furthermore, even with the warnings, users may disregard or ignore the warnings or request. Accordingly, there is a need for improved solutions to facilitate removal of peripheral devices (e.g., removable storage media devices) from its host computer system.
Broadly speaking, the invention relates to improved techniques for rendering a peripheral device removable (e.g., unpluggable). According to one aspect of the invention, the peripheral device is rendered removable from a host computer without preparatory user actions. In effect, the peripheral device can be automatically prepared for removal in the event that its user removes (unplugs) it from its host computer. According to another aspect of the invention, the peripheral device includes a data storage device that is mounted to a file system of the host computer when the host computer desires access to the data storage device. Otherwise, the data storage device is normally unmounted so that if the peripheral device were to be removed (e.g., unplugged) no harm or damage to data stored therein would occur. These aspects of the invention can be utilized alone or in combination with one another. The invention is particularly well suited for peripheral devices that are media players which are resulting xe2x80x9chotxe2x80x9d unpluggable without detrimental consequences.
The invention can be implemented in numerous ways, including as a method, system, device, and computer readable medium. Several embodiments of the invention are discussed below.
As a method for accessing a portable media player by a host computer over a data link, one embodiment of the invention includes at least the acts of: receiving an indication that the portable media player has been attached to the host computer via the data link; logically connecting the portable media player to a file system of the host computer; performing first media-based processing at the host computer which accesses the portable media player; and logically disconnecting the portable media player from the file system without detaching the portable media player from the host computer via the data link, the logically disconnecting being performed after performance of the first media-based processing.
As a computer-implemented method for accessing a portable media player from a host computer, where the portable media player has at least a storage device for storing media content, one embodiment of the invention includes at least the acts of: detecting presence of the portable media player on a bus associated with the host computer; mounting the storage device of the portable media player with a file system of the host computer; accessing the storage device from the host computer over the bus to perform initial media-based processing; unmounting the storage device of the portable media player from the file system of the host computer once the accessing for the initial media-based processing is completed; determining, subsequent to the unmounting, whether access to the storage device is needed to perform subsequent media-based processing; remounting the storage device of the portable media player with the file system of the host computer when the determining determines that access to the storage device is needed; accessing the storage device from the host computer over the bus to perform the subsequent media-based processing; and unmounting the storage device of the portable media player from the file system of the host computer once the accessing for the subsequent media-based processing is completed.
As a computer readable medium including at least computer program code for accessing a portable media player from a host computer, where the portable media player has at least a storage device for storing media content, one embodiment of the invention includes at least: computer program code for detecting presence of the portable media player on a bus associated with the host computer; computer program code for mounting the storage device of the portable media player with a file system of the host computer; computer program code for accessing the storage device from the host computer over the bus to perform initial media-based processing; and computer program code for unmounting the storage device of the portable media player from the file system of the host computer once it is determined that the initial media-based processing is completed. Optionally, the embodiment can also include computer program code for detecting physical disconnection of the portable media player from the bus associated with the host computer.
Other aspects and advantages of the invention will become apparent from the following detailed description taken in conjunction with the accompanying drawings which illustrate, by way of example, the principles of the invention.